package com.juyu.miliao.api.dao.mysql;

import com.juyu.miliao.api.domain.UserBindWxInfo;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * @author xuanqicheng
 * @create 2019-27-13:57
 */
@Repository
public class UserBindWxInfoDao {

    @Autowired
    private SqlSession sqlSession;

    public UserBindWxInfo getUserBindWxByOpenid(String openid) {

        return sqlSession.selectOne("selectUserBindWxByOpenid",openid);

    }

    public void insert(UserBindWxInfo userBindWxInfo) {
        sqlSession.insert("insertUserBindWxInfo",userBindWxInfo);
    }

    public int updateGoldStatus(long userId) {
        return sqlSession.update("updateGoldStatus",userId);
    }
}
